package util;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.LinkedList;

public class Log {
	
	private static LinkedList<String> logs = new LinkedList<String>();
	private static SimpleDateFormat format = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
	private static final int loggerSize = 300;
		
	public static void write(String str){		
		logs.add(format.format(new Date())+": "+str+"\n");
		if(logs.size()>loggerSize)logs.removeFirst();
	}
	
	public static LinkedList<String> getLogs(){
		return logs;
	}
}
